<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShortUrlsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('short_urls', function (Blueprint $table) {
            $table->increments('id');
            $table->string('agent_id')->index()->default('')->comment('代理ID');
            $table->string('link')->index()->default('')->comment('短网址');
            $table->text('url')->nullable()->comment('原网址');
            $table->string('key')->nullable()->comment('密文');
            $table->string('password')->nullable()->comment('访问密码');
            $table->string('out_video')->nullable()->comment('盒子外链');
            $table->tinyInteger('state')->default('1')->comment('状态：1正常，-1封禁，0停用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('short_urls');
    }
}
